package clm.tail;

import java.text.SimpleDateFormat;
import java.util.Date;

public class JumpStart {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	
		System.out.println("Usage (list files individually):");
		System.out.println("\tjava -jar tailMerge.jar input1.txt input2.txt input3.txt");
		System.out.println("\tAll file paths should be the full or relative file path");
		System.out.println("\targ[0]-arg[n]:\tinput files to merge");
		System.out.println();
	
		if(args.length < 1){
			System.out.println("Invalid number of arguments: " + args.length);
			return;
		}
		
		String[] fileNameArray = new String[args.length];
		for(int i = 0; i < args.length; i++){
			fileNameArray[i] = args[i];
		}
		
		LogInputThread[] offerThreads = new LogInputThread[fileNameArray.length];
		for(int i = 0; i < offerThreads.length; i++){
			offerThreads[i] = new LogInputThread();
			offerThreads[i].start(fileNameArray[i], i);
		}
		
		
		SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.SSS");
		
		ConsoleOutputThread outputThread = new ConsoleOutputThread();
		outputThread.start();

		System.out.println(sdf.format(new Date()) + " - Jump start complete.");
	}

}
